Parser Combinators

Seminar

Parser combinators are an approach to writing parsers in which a library defines a set of basic components and combinators for building parsers.

The traditional approach to writing parsers uses a tool like YACC: We write down a grammar, and YACC is used as pre-processer to turn it into a parser. We can instead write parsers directly in our programming language, gaining simplicity and flexibility. The use of parser combinators makes this easier by allowing us to build parsers in a compositional fashion. This allows our parsers to look very similar to a grammar specification, while being more powerful.

For this seminar topic, your task will be to explain the basic concepts of parser combinators and how to use them. You will consider their strengths and challenges and explore current research directions. You will also try out Elm/Parser, Megaparsec or some other parser combinator library of your choice and use it to write a small parser.